#ifndef MESH_H
#define MESH_H

#include<QOpenGLShaderProgram>
#include<QOpenGLFunctions_3_3_Core>
#include<vector>
#include<string>
using namespace std;

struct Vertex
{
    QVector3D Position;
    QVector3D Normal;
    QVector2D TexCoords;
};

struct Texture
{
    unsigned int id;
    string type;
    string path;
};

class Mesh
{
public:
    vector<Vertex> vertices;
    vector<unsigned int> indices;
    vector<Texture> textures;

    void Draw(QOpenGLShaderProgram &shader);
    Mesh(QOpenGLFunctions_3_3_Core *glFuns,vector<Vertex> vertices,vector<unsigned int> indices,vector<Texture> textures);

private:
    unsigned int VAO,VBO,EBO;
    void setupMesh();
    QOpenGLFunctions_3_3_Core *m_glFuns;
};

#endif // MESH_H
